// 封装工具函数

// 递归遍历，改变地址名称
function changeAddress(arr) {
    let newArr;
    newArr = arr.map((ele) => {
        ele.text = ele.cityname;
        if (ele.children && ele.children.length != 0) {
            ele.children = changeAddress(ele.children);
        }
        return ele;
    });
    return newArr;
}

export { changeAddress };
